const http = (obj)=>{
	// obj { url,method,header,data }
	return new Promise((reslove,reject)=>{
		uni.request({
			url: 'http://localhost:3000/api' + obj.url,
			method:obj.method || 'GET',
			header:obj.header || { 'content-type':'application/json' },
			data:obj.data || {},
			success: (res) => reslove(res),
			fail: (err) => reject(err)
		})
	})
}

export default http